package com.ybu.service.impl;

import com.ybu.common.ServiceCode;
import com.ybu.common.ServiceException;
import com.ybu.mapper.ProductMapper;
import com.ybu.pojo.vo.ProductCategoryVO;
import com.ybu.pojo.vo.ProductVO;
import com.ybu.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<ProductVO> getProductList() {
        List<ProductVO> productList = productMapper.getProductList();
        if(productList == null&& productList.size()!=0){
            throw new ServiceException(ServiceCode.ERR_NOT_FOUND,"没有新商品信息");
        }
        return productList;

    }
}
